onActivityCreated

open fun onActivityCreated(@Nullable savedInstanceState: Bundle)(source)

Deprecated

use onViewCreated for code touching the view created by onCreateView and onCreate for other initialization. To get a callback specifically when a Fragment activity's onCreate is called, register a androidx.lifecycle.LifecycleObserver on the Activity's Lifecycle in onAttach, removing it when it receives the CREATED callback.

Called when the fragment's activity has been created and this fragment's view hierarchy instantiated. It can be used to do final initialization once these pieces are in place, such as retrieving views or restoring state. It is also useful for fragments that use setRetainInstance to retain their instance, as this callback tells the fragment when it is fully associated with the new activity instance. This is called after onCreateView and before onViewStateRestored.

Parameters

savedInstanceState

If the fragment is being re-created from a previous saved state, this is the state.